"""
给定不超过9的正整数a，
给定正整数n,n是偶数,4<=n<=18，
要求编写程序求aa+aaaa+aaaaaa+⋯+aa⋯a（n个a）之和
"""
a, b = input().split()
a, b = int(a), int(b)
a *= 10 + 1
c = a
sum = 0
for i in range(2, b+1, 2):
    sum += a
    a = a * 100 + c
print(sum)